﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Manage/Main.Master" AutoEventWireup="true"
    CodeBehind="ServiceManage.aspx.cs" Inherits="AUV5.Web.Manage.ServiceManage" %>

<%@ Import Namespace="AUV5.Model" %>
<%@ Import Namespace="AUV5.BLL" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        <%--.serviceStatus
        {
            position:relative;    
        }
        .managePanel
        {
            border:1px solid red;
            position:absolute;
            display:none;
            background:gray;    
        }--%>
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h3>
        查询
    </h3>
    <fieldset>
        <p>
            发布人：<asp:TextBox ID="txtUserName" runat="server" />
            已删除<asp:CheckBox ID="cbxIsDel" Text="" runat="server" />
        </p>
        <p>
            <asp:Button ID="btnSearch" Text="查找" runat="server" OnClick="btnSearch_Click" />
        </p>
    </fieldset>
    <h3>
        服务管理
    </h3>
    <table cellpadding="0" cellspacing="0">
        <tr>
            <td>
                发布人
            </td>
            <td style="width: 160px;">
                标题
            </td>
            <td>
                类别
            </td>
            <td>
                视频
            </td>
            <%--<td>
                创建时间
            </td>--%>
            <td>
                修改时间
            </td>
            <%-- <td>
                状态
            </td>--%>
            <td align="center">
                管理
            </td>
        </tr>
        <asp:Repeater ID="repService" runat="server" OnItemDataBound="repService_ItemDataBound"
            OnItemCommand="repService_ItemCommand">
            <ItemTemplate>
                <tr>
                    <td>
                        <%#(Container.DataItem as ServiceInfo).UserName %>
                    </td>
                    <td>
                        <%#(Container.DataItem as ServiceInfo).Title %>
                    </td>
                    <td>
                        <%#(Container.DataItem as ServiceInfo).CategoryName%>
                    </td>
                    <td class="action">
                        <%--<asp:LinkButton ID="lbtnVideo" CommandArgument="<%#(Container.DataItem as ServiceInfo).ServiceID %>" Text="" runat="server" />--%>
                        <a href="/Manage/ServiceVideoManage.aspx?serviceID=<%#(Container.DataItem as ServiceInfo).ServiceID %>"
                            target="_blank" class="edit" <%#ServiceAttachmentBLL.Instance.GetVideo((Container.DataItem as ServiceInfo).ServiceID)==null?"onclick='return false'":"" %>
                            onclick="return openDialog(this.href,460,500,200,300)">
                            <%#ServiceAttachmentBLL.Instance.GetVideo((Container.DataItem as ServiceInfo).ServiceID)==null?"无":"查看" %></a>
                    </td>
                    <%--<td>
                        <%#(Container.DataItem as ServiceInfo).CreateDate.ToString("MM/dd HH:mm") %>
                    </td>--%>
                    <td>
                        <%#(Container.DataItem as ServiceInfo).UpdateDate.ToString("MM/dd HH:mm") %>
                    </td>
                    <%-- <td>
                       <%#Enum.GetName(typeof(AUV5.Common.Enum.ServiceStatus),(Container.DataItem as ServiceInfo).StatusID)%> 
                    </td>--%>
                    <td class="action">
                        <a href="/Pages/ServiceDetail.aspx?serviceID=<%#(Container.DataItem as ServiceInfo).ServiceID%>"
                            target="_blank" class="view">查看</a> <a href="#" class="view serviceStatus">管理</a>
                        <p class="managePanel">
                            <asp:HiddenField ID="hfServiceID" runat="server" Value="<%#(Container.DataItem as ServiceInfo).ServiceID%>" />
                            <asp:LinkButton ID="lbtnFeature" class="edit" CommandName="Feature" CommandArgument="<%#(Container.DataItem as ServiceInfo).ServiceID%>"
                                runat="server" Visible="false">推荐</asp:LinkButton>
                            <asp:LinkButton ID="lbtnEnable" class="edit" CommandName="Enable" CommandArgument="<%#(Container.DataItem as ServiceInfo).ServiceID%>"
                                runat="server" Visible="false">启用</asp:LinkButton>
                            <asp:LinkButton ID="lbtnDisable" class="edit" CommandName="Disable" CommandArgument="<%#(Container.DataItem as ServiceInfo).ServiceID%>"
                                runat="server" Visible="false">禁用</asp:LinkButton>
                            <asp:LinkButton ID="lbtnDelete" class="delete" CommandName="Delete" CommandArgument="<%#(Container.DataItem as ServiceInfo).ServiceID%>"
                                runat="server" Visible="false" OnClientClick="return confirm('确认要删除该服务？')">删除</asp:LinkButton>
                            <asp:LinkButton ID="lbtnRecover" class="delete" CommandName="Recover" CommandArgument="<%#(Container.DataItem as ServiceInfo).ServiceID%>"
                                runat="server" Visible="false">撤消删除</asp:LinkButton>
                        </p>
                    </td>
                </tr>
            </ItemTemplate>
        </asp:Repeater>
        <tr>
            <td colspan="7">
                <webdiyer:AspNetPager ID="AspNetPager1" runat="server" FirstPageText="首页" LastPageText="尾页"
                    NextPageText="后页" PagingButtonLayoutType="Span" PrevPageText="前页" SubmitButtonText="Go"
                    TextAfterPageIndexBox="页" TextBeforePageIndexBox="转到" OnPageChanged="AspNetPager1_PageChanged">
                </webdiyer:AspNetPager>
            </td>
        </tr>
    </table>
    <br />
</asp:Content>
